using DSPCalculator.mechanics;

namespace DSPCalculator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            
        }

        public Bitmap bitmap { get; set; }
        Calculator c;
        private void Form1_Load(object sender, EventArgs e)
        {
            c = new Calculator();
            bitmap = new Bitmap(1000, 1000);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Refresh();
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            Refresh();
        }

        private void Refresh()
        {
            string itemName = textBox1.Text;
            decimal nps = decimal.Parse(textBox2.Text);
            float sheer = (float)numericUpDown1.Value;
            c.Visualize(bitmap, itemName, nps,sheer);
            pictureBox1.Image = bitmap;
        }
    }
}